//
//  PKPlayerManger.h
//  MusicPlayer
//
//  Created by lanou on 15/10/5.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

#import "MusicPlayViewController.h"
//保存播放的类型
typedef NS_ENUM(NSInteger, playType){
    //单曲循环
    PlayTypeSingle,
    //列表播放
    PlayTypeList,
    //随机播放
    PlayTypeRandom
};
@interface PKPlayerManger : NSObject
// 播放类型
@property (nonatomic, assign) playType playType;
// 总时间
@property (nonatomic, assign, readonly) NSUInteger finishTime;
// 当前时间
@property (nonatomic, assign, readonly) NSUInteger currentTime;
@property (nonatomic, strong) AVPlayer *avPlayer;
@property (nonatomic, strong)MusicPlayViewController * musicPlayVC;
@property (nonatomic, strong)NSArray * musicArr;
@property (nonatomic, assign)NSInteger index;
@property (nonatomic, copy)NSString * musicTitle;
// 播放的数组地址
- (void)setMangerMusicArray:(NSArray *)array;
// 单例
+ (instancetype)shareManger;
// 下一曲
- (void)nextMusic;
// 上一曲
- (void)beforeMusic;
// 播放/暂停
- (void)playAndPause;
// 跳转
- (void)seekToTime:(NSUInteger)time;
// 停止
- (void)stop;
// 根据外界传过来的下标来播放
- (void)playWithIndex:(NSInteger)index;

@end
